Skip to content

docs: document mark and scope event sanitizers [6/6]#376

Open
willkill07 wants to merge 1 commit into
NVIDIA:mainfrom
willkill07:docs/relay-409-event-sanitizers
Open

docs: document mark and scope event sanitizers [6/6]#376
willkill07 wants to merge 1 commit into
NVIDIA:mainfrom
willkill07:docs/relay-409-event-sanitizers

Conversation

@willkill07

@willkill07 willkill07 commented Jul 7, 2026

Copy link
Copy Markdown
Member

Overview

Documents the RELAY-409 event sanitizer and PII redaction behavior in one independent, docs-only PR so the writing review is not repeated across the implementation stack.

  • I confirm this contribution is my own work, or I have the right to submit it under this project's license.
  • I searched existing issues and open pull requests, and this does not duplicate existing work.

Details

  • Adds a dedicated event sanitizer reference with callback semantics, ordering, registration lifetimes, cross-language APIs, and dynamic-plugin protocol values.
  • Updates middleware, event, scope/mark, plugin authoring, and pending-mark guidance.
  • Documents PII mark = true defaults, opt-out behavior, broader input/output scope coverage, and exporter privacy guarantees.
  • Updates Python, Node.js, and experimental Go package READMEs plus relevant agent skills.
  • Rebases onto main after PRs feat(sanitizers)!: add mark and scope event sanitizer registries [1/6] #371feat: expose event sanitizers through C and Go [5/6] #375 merged, resolving the subsequent documentation reorganization.
  • Contains no implementation commits.
  • Breaking changes: none.

Validation: just docs, just docs-linkcheck, and uv run pre-commit run --all-files.

Where should the reviewer start?

Start with docs/reference/event-sanitizers.mdx, then review docs/configure-plugins/pii-redaction/configuration.mdx for the privacy contract changes.

Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)

  • Relates to: RELAY-409

Summary by CodeRabbit

  • Documentation
    • Added comprehensive guidance for event sanitizers covering mark and scope events.
    • Documented sanitization of data, category_profile, and metadata while preserving immutable event context.
    • Added registration, ordering, configuration, and binding-specific usage details.
    • Expanded PII redaction documentation to include mark and generic scope observability.
    • Added examples and clarified sanitized payload delivery to subscribers and exporters.

@github-actions github-actions Bot added size:M PR is medium Documentation documentation-related labels Jul 7, 2026
@willkill07 willkill07 added this to the 0.6 milestone Jul 7, 2026
@willkill07 willkill07 self-assigned this Jul 7, 2026
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

@willkill07 willkill07 changed the title docs: document mark and scope event sanitizers docs: document mark and scope event sanitizers [6/6] Jul 7, 2026
Signed-off-by: Will Killian <wkillian@nvidia.com>
@willkill07 willkill07 force-pushed the docs/relay-409-event-sanitizers branch from d72e192 to 97d8c7b Compare July 10, 2026 20:55
@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

This documentation update introduces the mark and scope event sanitizer contract, registration and ordering rules, binding guidance, PII redaction configuration, and lifecycle semantics for sanitized events and pending marks.

Changes

Event sanitizer contract

Layer / File(s) Summary
Sanitizer contract and registration
docs/reference/event-sanitizers.mdx, docs/about-nemo-relay/concepts/events.mdx
Defines mark, scope-start, and scope-end sanitizer behavior, mutable observability fields, immutable event context, registration lifetimes, binding APIs, and examples.

Middleware and plugin integration

Layer / File(s) Summary
Middleware and plugin integration
.agents/skills/add-middleware/SKILL.md, docs/about-nemo-relay/concepts/middleware.mdx, docs/build-plugins/language-binding/*, crates/node/README.md, go/nemo_relay/README.md, python/nemo_relay/README.md
Adds event sanitizer guidance to middleware design, plugin registration, binding capabilities, pipeline ordering, and test checklists.

PII redaction

Layer / File(s) Summary
PII redaction configuration
docs/configure-plugins/pii-redaction/*
Adds the mark sanitization surface and documents configuration, backend support, path semantics, generic scope handling, and sanitized event delivery.

Lifecycle and export semantics

Layer / File(s) Summary
Lifecycle and export semantics
docs/reference/tool-execution-intercept-outcomes.mdx, docs/instrument-applications/adding-scopes-and-marks.mdx, skills/nemo-relay-export-atif-trajectories/SKILL.md
Clarifies sanitizer processing for pending marks, subscriber/exporter delivery, and sanitized ATIF trajectory emission.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • NVIDIA/NeMo-Relay#371: Implements the mark and scope event sanitizer registries and runtime behavior documented here.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title follows Conventional Commits and accurately summarizes the docs-only change about event sanitizers.
Description check ✅ Passed The description matches the template with Overview, Details, reviewer start, checkboxes, and related issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@willkill07 willkill07 marked this pull request as ready for review July 10, 2026 23:26
@willkill07 willkill07 requested review from a team and lvojtku as code owners July 10, 2026 23:26

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.agents/skills/add-middleware/SKILL.md:
- Around line 49-51: The documented event-sanitizer workflow in the “Mark and
scope events” section omits exporter dispatch. Update the dispatch-stage wording
to explicitly say “subscriber and exporter dispatch,” ensuring it reflects the
destinations covered by the event-sanitizer contract.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: b908c56a-a4ea-4788-b77d-eb922007ce71

📥 Commits

Reviewing files that changed from the base of the PR and between e16e1cd and 97d8c7b.

📒 Files selected for processing (15)
  • .agents/skills/add-middleware/SKILL.md
  • crates/node/README.md
  • docs/about-nemo-relay/concepts/events.mdx
  • docs/about-nemo-relay/concepts/middleware.mdx
  • docs/build-plugins/language-binding/about.mdx
  • docs/build-plugins/language-binding/advanced-configuration.mdx
  • docs/build-plugins/language-binding/register-behavior.mdx
  • docs/configure-plugins/pii-redaction/about.mdx
  • docs/configure-plugins/pii-redaction/configuration.mdx
  • docs/instrument-applications/adding-scopes-and-marks.mdx
  • docs/reference/event-sanitizers.mdx
  • docs/reference/tool-execution-intercept-outcomes.mdx
  • go/nemo_relay/README.md
  • python/nemo_relay/README.md
  • skills/nemo-relay-export-atif-trajectories/SKILL.md
📜 Review details
🧰 Additional context used
📓 Path-based instructions (23)
**/*.mdx

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)

MDX top-of-file SPDX comments must use {/* ... */} delimiters instead of HTML comment delimiters (Must-Fix)

In MDX files, top-of-file comments must use JSX comment delimiters ({/* to open and */} to close); do not use HTML comments for MDX SPDX headers

Files:

  • docs/instrument-applications/adding-scopes-and-marks.mdx
  • docs/build-plugins/language-binding/about.mdx
  • docs/build-plugins/language-binding/register-behavior.mdx
  • docs/build-plugins/language-binding/advanced-configuration.mdx
  • docs/about-nemo-relay/concepts/events.mdx
  • docs/reference/tool-execution-intercept-outcomes.mdx
  • docs/about-nemo-relay/concepts/middleware.mdx
  • docs/reference/event-sanitizers.mdx
  • docs/configure-plugins/pii-redaction/about.mdx
  • docs/configure-plugins/pii-redaction/configuration.mdx
**/*.{md,mdx}

📄 CodeRabbit inference engine (AGENTS.md)

Update README.md, fern/, package READMEs, and binding-support notes when public behavior, package names, examples, or supported bindings change.

**/*.{md,mdx}: Prefer the documented public API, not internal shortcuts
Keep package names, repo references, and build commands current
Keep release-process and release-notes guidance in repo-maintainer docs such as RELEASING.md, not as user-facing docs pages or CHANGELOG.md
Keep stable user-facing wrappers at scripts/ root in docs and examples; only point at namespaced helper paths when documenting internal maintenance work
When detailed dynamic plugin guides exist, keep Rust native plugin examples, Python worker plugin examples, and grpc-v1 protocol details on separate pages

If links in documentation change, run just docs-linkcheck.

Files:

  • docs/instrument-applications/adding-scopes-and-marks.mdx
  • docs/build-plugins/language-binding/about.mdx
  • docs/build-plugins/language-binding/register-behavior.mdx
  • go/nemo_relay/README.md
  • python/nemo_relay/README.md
  • docs/build-plugins/language-binding/advanced-configuration.mdx
  • docs/about-nemo-relay/concepts/events.mdx
  • skills/nemo-relay-export-atif-trajectories/SKILL.md
  • crates/node/README.md
  • docs/reference/tool-execution-intercept-outcomes.mdx
  • docs/about-nemo-relay/concepts/middleware.mdx
  • docs/reference/event-sanitizers.mdx
  • docs/configure-plugins/pii-redaction/about.mdx
  • docs/configure-plugins/pii-redaction/configuration.mdx
**/*.{md,markdown,mdx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Add the SPDX license header to all Markdown/MDX documentation files using the HTML comment block form.

Files:

  • docs/instrument-applications/adding-scopes-and-marks.mdx
  • docs/build-plugins/language-binding/about.mdx
  • docs/build-plugins/language-binding/register-behavior.mdx
  • go/nemo_relay/README.md
  • python/nemo_relay/README.md
  • docs/build-plugins/language-binding/advanced-configuration.mdx
  • docs/about-nemo-relay/concepts/events.mdx
  • skills/nemo-relay-export-atif-trajectories/SKILL.md
  • crates/node/README.md
  • docs/reference/tool-execution-intercept-outcomes.mdx
  • docs/about-nemo-relay/concepts/middleware.mdx
  • docs/reference/event-sanitizers.mdx
  • docs/configure-plugins/pii-redaction/about.mdx
  • docs/configure-plugins/pii-redaction/configuration.mdx
{docs,examples}/**/*

📄 CodeRabbit inference engine (.agents/skills/rename-surfaces/SKILL.md)

Update docs and examples.

Files:

  • docs/instrument-applications/adding-scopes-and-marks.mdx
  • docs/build-plugins/language-binding/about.mdx
  • docs/build-plugins/language-binding/register-behavior.mdx
  • docs/build-plugins/language-binding/advanced-configuration.mdx
  • docs/about-nemo-relay/concepts/events.mdx
  • docs/reference/tool-execution-intercept-outcomes.mdx
  • docs/about-nemo-relay/concepts/middleware.mdx
  • docs/reference/event-sanitizers.mdx
  • docs/configure-plugins/pii-redaction/about.mdx
  • docs/configure-plugins/pii-redaction/configuration.mdx
**/*

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

**/*: Format changed files with the language-native formatter before the final lint/test pass.
If dynamic plugin behavior changed, use maintain-dynamic-plugins and include the native SDK, worker protocol, Python SDK, docs, packaging, and Codecov surfaces in the validation plan.
If code changes alter APIs, bindings, commands, paths, packaging behavior, observability/adaptive semantics, or documented best practices, update any dependent maintainer or consumer skills in the same branch.
During iteration, prefer uv run pre-commit run --files <changed files...>.
Before review or handoff, run uv run pre-commit run --all-files.

**/*: Use karpathy-guidelines alongside this skill; keep changes scoped, surface assumptions, and define focused validation before editing.
Expose the new middleware surface in every affected binding, following the add-binding-feature cross-binding checklist.
Provide parity coverage in every affected binding.
Run validate-change to validate the implementation.

Files:

  • docs/instrument-applications/adding-scopes-and-marks.mdx
  • docs/build-plugins/language-binding/about.mdx
  • docs/build-plugins/language-binding/register-behavior.mdx
  • go/nemo_relay/README.md
  • python/nemo_relay/README.md
  • docs/build-plugins/language-binding/advanced-configuration.mdx
  • docs/about-nemo-relay/concepts/events.mdx
  • skills/nemo-relay-export-atif-trajectories/SKILL.md
  • crates/node/README.md
  • docs/reference/tool-execution-intercept-outcomes.mdx
  • docs/about-nemo-relay/concepts/middleware.mdx
  • docs/reference/event-sanitizers.mdx
  • docs/configure-plugins/pii-redaction/about.mdx
  • docs/configure-plugins/pii-redaction/configuration.mdx
docs/**/*

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

If documentation examples or commands under docs/ change, run the targeted docs checks appropriate to the change.

Files:

  • docs/instrument-applications/adding-scopes-and-marks.mdx
  • docs/build-plugins/language-binding/about.mdx
  • docs/build-plugins/language-binding/register-behavior.mdx
  • docs/build-plugins/language-binding/advanced-configuration.mdx
  • docs/about-nemo-relay/concepts/events.mdx
  • docs/reference/tool-execution-intercept-outcomes.mdx
  • docs/about-nemo-relay/concepts/middleware.mdx
  • docs/reference/event-sanitizers.mdx
  • docs/configure-plugins/pii-redaction/about.mdx
  • docs/configure-plugins/pii-redaction/configuration.mdx
**

⚙️ CodeRabbit configuration file

**:

AGENTS.md

This file provides guidance to agents, including Claude Code and OpenAI Codex, when working in this repository.

Project Overview

NeMo Relay is a multi-language agent runtime framework for execution scopes, lifecycle events, middleware, plugins, and observability around tool and LLM calls. The core runtime is Rust. Primary supported bindings are Rust, Python, and Node.js. Go and the raw C FFI are experimental and source-first.

The shared runtime model is:

  1. Scope stacks decide where work belongs and which scope-local behavior is visible.
  2. Middleware registries decide what guardrails and intercepts run around managed calls.
  3. Plugins install reusable runtime behavior from configuration.
  4. Events record runtime behavior in ATOF form.
  5. Subscribers and exporters consume events in-process or export them to ATIF, OpenTelemetry, OpenInference, or other backends.

Repository Structure

The repository layout separates the Rust runtime, language bindings,
documentation, integrations, and agent-facing skills.

crates/
  core/       # Rust core runtime crate, published as nemo-relay
  adaptive/   # Adaptive runtime primitives and plugin components
  python/     # PyO3 native extension for the Python package
  ffi/        # Raw C ABI layer used by downstream bindings such as Go
  node/       # NAPI Node.js binding and JavaScript/TypeScript entry points
python/
  nemo_relay/  # Python wrapper package: scopes, tools, LLM, middleware, typed helpers, plugins, adaptive helpers
  tests/      # Python tests
go/
  nemo_relay/  # Experimental Go CGo binding and tests
fern/         # Fern documentation site
scripts/      # Stable wrappers and helper scripts; build/test/docs entry points live in justfile
skills/       # Published Codex/agent skills for NeMo Relay usage patterns

Prerequisites

Insta...

Files:

  • docs/instrument-applications/adding-scopes-and-marks.mdx
  • docs/build-plugins/language-binding/about.mdx
  • docs/build-plugins/language-binding/register-behavior.mdx
  • go/nemo_relay/README.md
  • python/nemo_relay/README.md
  • docs/build-plugins/language-binding/advanced-configuration.mdx
  • docs/about-nemo-relay/concepts/events.mdx
  • skills/nemo-relay-export-atif-trajectories/SKILL.md
  • crates/node/README.md
  • docs/reference/tool-execution-intercept-outcomes.mdx
  • docs/about-nemo-relay/concepts/middleware.mdx
  • docs/reference/event-sanitizers.mdx
  • docs/configure-plugins/pii-redaction/about.mdx
  • docs/configure-plugins/pii-redaction/configuration.mdx
{docs/**,README.md,CONTRIBUTING.md,RELEASING.md,SECURITY.md}

⚙️ CodeRabbit configuration file

{docs/**,README.md,CONTRIBUTING.md,RELEASING.md,SECURITY.md}: Review documentation for technical accuracy against the current API, command correctness, and consistency across language bindings.
Flag stale examples, missing SPDX headers where required, and instructions that no longer match CI or pre-commit behavior.

Files:

  • docs/instrument-applications/adding-scopes-and-marks.mdx
  • docs/build-plugins/language-binding/about.mdx
  • docs/build-plugins/language-binding/register-behavior.mdx
  • docs/build-plugins/language-binding/advanced-configuration.mdx
  • docs/about-nemo-relay/concepts/events.mdx
  • docs/reference/tool-execution-intercept-outcomes.mdx
  • docs/about-nemo-relay/concepts/middleware.mdx
  • docs/reference/event-sanitizers.mdx
  • docs/configure-plugins/pii-redaction/about.mdx
  • docs/configure-plugins/pii-redaction/configuration.mdx
{crates/core/src/plugin/dynamic/**,crates/plugin/**,crates/worker/**,crates/worker-proto/**,crates/types/**,python/plugin/**,examples/rust-native-plugin/**,examples/python-grpc-worker-plugin/**,docs/build-plugins/**}

📄 CodeRabbit inference engine (.agents/skills/maintain-dynamic-plugins/SKILL.md)

Keep the stable boundary explicit: native plugins cross a C ABI, and worker plugins cross grpc-v1.

Files:

  • docs/build-plugins/language-binding/about.mdx
  • docs/build-plugins/language-binding/register-behavior.mdx
  • docs/build-plugins/language-binding/advanced-configuration.mdx
{crates/core/src/plugin/dynamic/**,examples/rust-native-plugin/**,examples/python-grpc-worker-plugin/**,docs/build-plugins/**}

📄 CodeRabbit inference engine (.agents/skills/maintain-dynamic-plugins/SKILL.md)

Native and worker plugins are trusted extensions; document that native plugins are in-process and unsandboxed, and worker plugins provide process isolation but not a security sandbox.

Files:

  • docs/build-plugins/language-binding/about.mdx
  • docs/build-plugins/language-binding/register-behavior.mdx
  • docs/build-plugins/language-binding/advanced-configuration.mdx
{docs/build-plugins/**,examples/rust-native-plugin/**,examples/python-grpc-worker-plugin/**}

📄 CodeRabbit inference engine (.agents/skills/maintain-dynamic-plugins/SKILL.md)

When detailed dynamic plugin guides exist, keep Rust native, Python worker, and grpc-v1 protocol details on separate pages.

Files:

  • docs/build-plugins/language-binding/about.mdx
  • docs/build-plugins/language-binding/register-behavior.mdx
  • docs/build-plugins/language-binding/advanced-configuration.mdx
**/*.{md,rst,html,txt}

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/assets/nvidia-style-brand-terminology.md)

**/*.{md,rst,html,txt}: Always spell NVIDIA in all caps. Do not use Nvidia, nvidia, nVidia, nVIDIA, or NV.
Use an NVIDIA before a noun because the name starts with an 'en' sound.
Do not add a registered trademark symbol after NVIDIA when referring to the company.
Use trademark symbols with product names only when the document type or legal guidance requires them.
Verify official capitalization, spacing, and hyphenation for product names.
Precede NVIDIA product names with NVIDIA on first mention when it is natural and accurate.
Do not rewrite product names for grammar or title-case rules.
Preserve third-party product names according to the owner's spelling.
Include the company name and full model qualifier on first use when it helps identify the model.
Preserve the official capitalization and punctuation of model names.
Use shorter family names only after the full name is established.
Spell out a term on first use and put the acronym in parentheses unless the acronym is widely understood by the intended audience.
Use the acronym on later mentions after it has been defined.
For long documents, reintroduce the full term if readers might lose context.
Form plurals of acronyms with s, not an apostrophe, such as GPUs.
In headings, common acronyms can remain abbreviated. Spell out the term in the first or second sentence of the body.
Common terms such as CPU, GPU, PC, API, and UI usually do not need to be spelled out for developer audiences.

Files:

  • go/nemo_relay/README.md
  • python/nemo_relay/README.md
  • skills/nemo-relay-export-atif-trajectories/SKILL.md
  • crates/node/README.md
**/*.{md,rst,html}

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/assets/nvidia-style-brand-terminology.md)

Link the first mention of a product name when the destination helps the reader.

Files:

  • go/nemo_relay/README.md
  • python/nemo_relay/README.md
  • skills/nemo-relay-export-atif-trajectories/SKILL.md
  • crates/node/README.md
**/*.{md,rst,txt}

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/assets/nvidia-style-guide.md)

Spell NVIDIA in all caps. Do not use Nvidia, nvidia, or NV.

Files:

  • go/nemo_relay/README.md
  • python/nemo_relay/README.md
  • skills/nemo-relay-export-atif-trajectories/SKILL.md
  • crates/node/README.md
**/*.{md,rst}

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/assets/nvidia-style-guide.md)

**/*.{md,rst}: Format commands, code elements, expressions, package names, file names, and paths as inline code.
Use descriptive link text. Avoid raw URLs and weak anchors such as "here" or "read more."
Use title case consistently for technical documentation headings.
Introduce code blocks, lists, tables, and images with complete sentences.
Write procedures as imperative steps. Keep steps parallel and split long procedures into smaller tasks.
Prefer active voice, present tense, short sentences, contractions, and plain English.
Use can for possibility and reserve may for permission.
Use after for temporal relationships instead of once.
Prefer refer to over see when the wording points readers to another resource.
Avoid culture-specific idioms, unnecessary Latinisms, jokes, and marketing exaggeration in technical docs.
Spell out months in body text, avoid ordinal dates, and use clear time zones.
Spell out whole numbers from zero through nine unless they are technical values, parameters, versions, or UI values.
Use numerals for 10 or greater and include commas in thousands.
Do not add trademark symbols to learning-oriented docs unless the source, platform, or legal guidance explicitly requires them.

Files:

  • go/nemo_relay/README.md
  • python/nemo_relay/README.md
  • skills/nemo-relay-export-atif-trajectories/SKILL.md
  • crates/node/README.md
**/*.md

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/assets/nvidia-style-technical-docs.md)

**/*.md: Use title case consistently in technical documentation headings
Avoid quotation marks, ampersands, and exclamation marks in headings
Keep product, event, research, and whitepaper names in their official title case
Use title case for table headers
Do not force social-media sentence case into technical docs
Format code elements, commands, parameters, package names, and expressions in monospace
Format directories, file names, and paths in monospace using backticks
Use angle brackets inside monospace for variables inside paths, such as /home/<username>/.login
Format error messages and strings in quotation marks, keeping literal code strings in code formatting when clearer
Format UI buttons, menus, fields, and labels in bold
Use angle brackets between UI labels for menu paths, such as File > Save As
Use italics for new terms on first use, sparingly and only when introducing the term
Use italics for publication titles
Format keyboard shortcuts in plain text, such as Press Ctrl+Alt+Delete
Use owner/repo link text for GitHub repositories, preferring [NVIDIA/NeMo](link) over prose references like 'the GitHub repo'
Introduce every code block with a complete sentence
Do not make a code block complete the grammar of the previous sentence
Do not continue a sentence after a code block
Use syntax highlighting when the format supports it for code blocks
Avoid the word 'snippet' unless the surrounding docs already use it as a term of art
Keep inline method, function, and class references consistent with nearby docs, omitting empty parentheses for prose readability when no call is shown
Use descriptive anchor text that matches the destination title when possible for links
Avoid raw URLs in running text
Avoid generic anchor text such as 'here,' 'this page,' and 'read more'
Include acronyms in link text when a linked term includes an acronym
Do not link long sentences or multiple sentences
Avoid links that pull readers away from a procedure unless the link is a p...

Files:

  • go/nemo_relay/README.md
  • python/nemo_relay/README.md
  • skills/nemo-relay-export-atif-trajectories/SKILL.md
  • crates/node/README.md
go/nemo_relay/**

📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)

Keep shared plugin helpers in go/nemo_relay aligned with plugin registration, composition, and lifecycle behavior.

Files:

  • go/nemo_relay/README.md
go/nemo_relay/**/*

⚙️ CodeRabbit configuration file

go/nemo_relay/**/*: Review Go binding changes for cgo memory ownership, race safety, callback cleanup, idiomatic exported APIs, and parity with Rust/FFI behavior.
Any API change should include focused Go tests and consider race-test behavior.

Files:

  • go/nemo_relay/README.md
python/nemo_relay/**/*

⚙️ CodeRabbit configuration file

python/nemo_relay/**/*: Review Python wrapper changes for typed API consistency, contextvars-based scope isolation, async behavior, and parity with the native extension.
Stubs and runtime implementations should stay aligned.

Files:

  • python/nemo_relay/README.md
**/SKILL.md

📄 CodeRabbit inference engine (AGENTS.md)

SKILL.md files are skill entrypoints and must start with YAML frontmatter containing at least name and description.

Files:

  • skills/nemo-relay-export-atif-trajectories/SKILL.md

⚙️ CodeRabbit configuration file

**/SKILL.md: Do not flag SKILL.md files for missing SPDX headers. Skill entrypoints intentionally start with YAML frontmatter instead.
Verify that every SKILL.md keeps valid YAML frontmatter with at least name and description fields before the Markdown body.

Files:

  • skills/nemo-relay-export-atif-trajectories/SKILL.md
crates/{python,ffi,node}/**/*

⚙️ CodeRabbit configuration file

crates/{python,ffi,node}/**/*: Treat binding changes as public API changes. Check for parity with the other language bindings, FFI ownership/lifetime safety,
callback error propagation, stable type conversion, and consistent async/stream semantics.
Flag changes that update one binding without corresponding tests or documentation for the same surface elsewhere.

Files:

  • crates/node/README.md
.agents/skills/**

⚙️ CodeRabbit configuration file

.agents/skills/**:

Maintainer Skills

This directory is the maintainer-only skill set for developing NeMo Relay
itself.

Use these skills for repository work such as:

  • Changing core or binding APIs
  • Maintaining integrations, packaging, CI, and docs
  • Extending middleware or observability internals
  • Validating library changes across bindings

Consumer-facing NeMo Relay usage skills live in the top-level skills/
directory so they can be exported separately for integrators and end users.

Files:

  • .agents/skills/add-middleware/SKILL.md
.agents/skills/add-middleware/**

⚙️ CodeRabbit configuration file

.agents/skills/add-middleware/**: ---
name: add-middleware
description: Add a new guardrail or intercept type to the NeMo Relay middleware pipeline
author: NVIDIA Corporation and Affiliates
license: Apache-2.0

Add a Middleware Type

Companion Guidance

Use karpathy-guidelines alongside this skill for implementation or review
work. Keep changes scoped, surface assumptions, and define focused validation
before editing.

NeMo Relay supports guardrails (validate/gate) and intercepts (transform) at various
pipeline stages. Adding a new middleware type requires changes across all layers.

Use this skill when introducing a new middleware registration surface or adding
middleware behavior to a new pipeline stage.

Lock The Design First

Decide these before editing code:

  • Is this for tools, LLMs, or both?
  • Is it a conditional guardrail, sanitize guardrail, request intercept, or
    execution intercept?
  • Does it run on request input, inner callable execution, stream chunks, or
    final response output?
  • Is the callback fallible, and how should callback failures propagate?
  • Does it need both global and scope-local registration?
  • What should subscribers observe in event.input and event.output after this
    middleware runs?

Pipeline Order

See docs/about/concepts/middleware.md for the full diagrams.

  • Tool execute:
    conditional guardrails -> request intercepts -> sanitize request (for events)
    | execution intercept chain(callable) -> sanitize response
  • LLM execute:
    conditional guardrails -> request intercepts -> sanitize request (for events)
    | execution intercept chain(callable) -> sanitize response

Core Steps

  1. Define or reuse the callback type alias in
    crates/core/src/api/runtime/callbacks.rs.
pub type MyNewFn = Box<dyn Fn(&str, Json) -> Json + Send + Sync>;
  1. Add the registry field to NemoRelayContextState in
    crates/core/src/api/runtime/state.rs.

Add a SortedRegistry<GuardrailEntry<MyNewFn>> or...

Files:

  • .agents/skills/add-middleware/SKILL.md
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
Repo: NVIDIA/NeMo-Relay

Timestamp: 2026-07-10T23:26:37.783Z
Learning: Before editing, decide whether the middleware targets tools, LLMs, marks, scope events, or a combination.
Learnt from: CR
Repo: NVIDIA/NeMo-Relay

Timestamp: 2026-07-10T23:26:37.783Z
Learning: Before editing, classify the middleware as a conditional guardrail, sanitize guardrail, request intercept, or execution intercept.
Learnt from: CR
Repo: NVIDIA/NeMo-Relay

Timestamp: 2026-07-10T23:26:37.783Z
Learning: Before editing, decide whether the middleware runs on request input, inner callable execution, stream chunks, or final response output.
Learnt from: CR
Repo: NVIDIA/NeMo-Relay

Timestamp: 2026-07-10T23:26:37.783Z
Learning: Before editing, define callback failure behavior and whether callback errors propagate.
Learnt from: CR
Repo: NVIDIA/NeMo-Relay

Timestamp: 2026-07-10T23:26:37.783Z
Learning: Before editing, determine whether both global and scope-local registration are required.
Learnt from: CR
Repo: NVIDIA/NeMo-Relay

Timestamp: 2026-07-10T23:26:37.783Z
Learning: Define what subscribers observe in `event.input` and `event.output` after middleware execution.
Learnt from: CR
Repo: NVIDIA/NeMo-Relay

Timestamp: 2026-07-10T23:26:37.783Z
Learning: For event sanitizers, define which of `data`, `category_profile`, and `metadata` may change and whether the event is immutable context.
🔇 Additional comments (25)
docs/about-nemo-relay/concepts/events.mdx (1)

106-110: LGTM!

crates/node/README.md (1)

44-46: LGTM!

go/nemo_relay/README.md (1)

42-44: LGTM!

python/nemo_relay/README.md (1)

43-45: LGTM!

docs/reference/event-sanitizers.mdx (1)

157-159: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Format protocol constants as code.

These stable registration values should use inline code formatting so readers can distinguish protocol constants from prose.

Proposed fix
-- `MARK_SANITIZE_GUARDRAIL = 30`
-- `SCOPE_SANITIZE_START_GUARDRAIL = 31`
-- `SCOPE_SANITIZE_END_GUARDRAIL = 32`
+- `MARK_SANITIZE_GUARDRAIL` = `30`
+- `SCOPE_SANITIZE_START_GUARDRAIL` = `31`
+- `SCOPE_SANITIZE_END_GUARDRAIL` = `32`

As per coding guidelines, format code elements, commands, parameters, package names, and expressions in monospace.

			> Likely an incorrect or invalid review comment.

Source: Coding guidelines

docs/about-nemo-relay/concepts/middleware.mdx (1)

11-12: LGTM!

Also applies to: 110-125, 281-283

docs/build-plugins/language-binding/about.mdx (1)

67-68: LGTM!

docs/build-plugins/language-binding/advanced-configuration.mdx (1)

161-162: LGTM!

docs/build-plugins/language-binding/register-behavior.mdx (1)

37-44: LGTM!

.agents/skills/add-middleware/SKILL.md (1)

27-27: LGTM!

Also applies to: 36-37, 96-96

docs/configure-plugins/pii-redaction/about.mdx (4)

11-12: LGTM!


33-34: LGTM!


70-74: LGTM!


93-97: LGTM!

docs/configure-plugins/pii-redaction/configuration.mdx (7)

69-71: LGTM!


91-91: LGTM!


136-136: LGTM!


164-169: LGTM!


180-180: LGTM!


290-293: LGTM!


344-360: LGTM!

docs/reference/tool-execution-intercept-outcomes.mdx (2)

32-37: LGTM!


49-50: LGTM!

docs/instrument-applications/adding-scopes-and-marks.mdx (1)

203-205: LGTM!

skills/nemo-relay-export-atif-trajectories/SKILL.md (1)

53-54: LGTM!

Comment on lines +49 to +51
- **Mark and scope events**:
specialized tool/LLM sanitizer (when applicable) -> mark or scope event
sanitizer -> subscriber dispatch

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Include exporters in the documented dispatch stage.

Event sanitizers run before both subscribers and exporters, but this workflow lists only subscriber dispatch. That can cause implementers to omit exporter-path validation or misunderstand the privacy guarantee. Change this to “subscriber and exporter dispatch.” The contract in docs/reference/event-sanitizers.mdx:9-56 explicitly covers both destinations.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.agents/skills/add-middleware/SKILL.md around lines 49 - 51, The documented
event-sanitizer workflow in the “Mark and scope events” section omits exporter
dispatch. Update the dispatch-stage wording to explicitly say “subscriber and
exporter dispatch,” ensuring it reflects the destinations covered by the
event-sanitizer contract.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation documentation-related size:M PR is medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant